package org.ftc.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.hibernate.annotations.GenericGenerator;

/**
 * 委員
 * @author Creasy Ho
 *
 */
@Entity
@Table(name = "COMMITTEE_TEAM")
//@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class CommitteeTeam extends BasicEntity implements Serializable  {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4858514952197893460L;

	@Id 
	@Column(name = "T_CODE", length = 50 )
	@GeneratedValue(generator = "uuid")
	@GenericGenerator(name = "uuid", strategy = "uuid2")
	private String tCode;
	
	@Temporal(TemporalType.DATE)
	@Column(name = "DATE" )
	private Date date;
	
	@Column(name = "ENABLE") 
	private boolean enable;
	
	@JsonIgnore
	@OneToMany(mappedBy = "committeeTeam",cascade = CascadeType.ALL,fetch = FetchType.LAZY)
	private Set<CTMap> emMapping = new HashSet<CTMap>(0);

	public String gettCode() {
		return tCode;
	}

	public void settCode(String tCode) {
		this.tCode = tCode;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public boolean isEnable() {
		return enable;
	}

	public void setEnable(boolean enable) {
		this.enable = enable;
	}

	public Set<CTMap> getEmMapping() {
		return emMapping;
	}

	public void setEmMapping(Set<CTMap> emMapping) {
		this.emMapping = emMapping;
	}

}
